home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1994 February: Tool Chest / Dev.CD Feb 94.toast / Tool Chest / Development Platforms / MPW Related / MPW Interfaces / PInterfaces / Controls.p < prev    next >
Encoding:
Text File  |  1993-09-17  |  6.7 KB  |  233 lines  |  [TEXT/MPS ]

  1. {
  2.     File:        Controls.p
  3.  
  4.     Copyright:    © 1983-1993 by Apple Computer, Inc.
  5.                 All rights reserved.
  6.  
  7.     Version:    System 7.1 for ETO #11
  8.     Created:    Tuesday, March 30, 1993 18:00
  9.  
  10. }
  11.  
  12. {$IFC UNDEFINED UsingIncludes}
  13. {$SETC UsingIncludes := 0}
  14. {$ENDC}
  15.  
  16. {$IFC NOT UsingIncludes}
  17.  UNIT Controls;
  18.  INTERFACE
  19. {$ENDC}
  20.  
  21. {$IFC UNDEFINED UsingControls}
  22. {$SETC UsingControls := 1}
  23.  
  24. {$I+}
  25. {$SETC ControlsIncludes := UsingIncludes}
  26. {$SETC UsingIncludes := 1}
  27. {$IFC UNDEFINED UsingQuickdraw}
  28. {$I $$Shell(PInterfaces)Quickdraw.p}
  29. {$ENDC}
  30. {$SETC UsingIncludes := ControlsIncludes}
  31.  
  32. CONST
  33. pushButProc = 0;
  34. checkBoxProc = 1;
  35. radioButProc = 2;
  36. useWFont = 8;
  37. scrollBarProc = 16;
  38. inButton = 10;
  39. inCheckBox = 11;
  40. inUpButton = 20;
  41. inDownButton = 21;
  42. inPageUp = 22;
  43. inPageDown = 23;
  44. inThumb = 129;
  45.  
  46. popupMenuProc = 1008;                { 63 * 16 }
  47. popupFixedWidth = $0001;            { popup menu CDEF variation codes }
  48. popupUseAddResMenu = $0004;
  49. popupUseWFont = $0008;
  50. popupTitleBold = $00000100;            { Popup Title characteristics }
  51. popupTitleItalic = $00000200;
  52. popupTitleUnderline = $00000400;
  53. popupTitleOutline = $00000800;
  54. popupTitleShadow = $00001000;
  55. popupTitleCondense = $00002000;
  56. popupTitleExtend = $00004000;
  57. popupTitleNoStyle = $00008000;
  58. popupTitleLeftJust = $00000000;
  59. popupTitleCenterJust = $00000001;
  60. popupTitleRightJust = $000000FF;
  61.  
  62. {
  63. axis constraints for DragGrayRgn call}
  64. noConstraint = 0;
  65. hAxisOnly = 1;
  66. vAxisOnly = 2;
  67.  
  68. {
  69. control messages}
  70. drawCntl = 0;
  71. testCntl = 1;
  72. calcCRgns = 2;
  73. initCntl = 3;
  74. dispCntl = 4;
  75. posCntl = 5;
  76. thumbCntl = 6;
  77. dragCntl = 7;
  78. autoTrack = 8;
  79. calcCntlRgn = 10;
  80. calcThumbRgn = 11;
  81.  
  82. cFrameColor = 0;
  83. cBodyColor = 1;
  84. cTextColor = 2;
  85. cThumbColor = 3;
  86. popupMenuCDEFproc = popupMenuProc;    { synonym for compatibility }
  87.  
  88. TYPE
  89. ControlPtr = ^ControlRecord;
  90. ControlHandle = ^ControlPtr;
  91. ControlRecord = PACKED RECORD
  92.  nextControl: ControlHandle;
  93.  contrlOwner: WindowPtr;
  94.  contrlRect: Rect;
  95.  contrlVis: Byte;
  96.  contrlHilite: Byte;
  97.  contrlValue: INTEGER;
  98.  contrlMin: INTEGER;
  99.  contrlMax: INTEGER;
  100.  contrlDefProc: Handle;
  101.  contrlData: Handle;
  102.  contrlAction: ProcPtr;
  103.  contrlRfCon: LONGINT;
  104.  contrlTitle: Str255;
  105.  END;
  106.  
  107. CCTabPtr = ^CtlCTab;
  108. CCTabHandle = ^CCTabPtr;
  109. CtlCTab = RECORD
  110.  ccSeed: LONGINT;                    {reserved}
  111.  ccRider: INTEGER;                    {see what you have done - reserved}
  112.  ctSize: INTEGER;                    {usually 3 for controls}
  113.  ctTable: ARRAY [0..3] OF ColorSpec;
  114.  END;
  115.  
  116. AuxCtlPtr = ^AuxCtlRec;
  117. AuxCtlHandle = ^AuxCtlPtr;
  118. AuxCtlRec = RECORD
  119.  acNext: AuxCtlHandle;                {handle to next AuxCtlRec}
  120.  acOwner: ControlHandle;            {handle for aux record's control}
  121.  acCTable: CCTabHandle;                {color table for this control}
  122.  acFlags: INTEGER;                    {misc flag byte}
  123.  acReserved: LONGINT;                {reserved for use by Apple}
  124.  acRefCon: LONGINT;                    {for use by application}
  125.  END;
  126.  
  127.  
  128. FUNCTION NewControl(theWindow: WindowPtr;boundsRect: Rect;title: Str255;
  129.  visible: BOOLEAN;value: INTEGER;min: INTEGER;max: INTEGER;procID: INTEGER;
  130.  refCon: LONGINT): ControlHandle;
  131.  INLINE $A954;
  132. PROCEDURE SetControlTitle(theControl: ControlHandle;title: Str255);
  133.  INLINE $A95F;
  134. PROCEDURE SetCTitle(theControl: ControlHandle;title: Str255);
  135.  INLINE $A95F;
  136. PROCEDURE GetControlTitle(theControl: ControlHandle;VAR title: Str255);
  137.  INLINE $A95E;
  138. PROCEDURE GetCTitle(theControl: ControlHandle;VAR title: Str255);
  139.  INLINE $A95E;
  140. FUNCTION GetNewControl(controlID: INTEGER;owner: WindowPtr): ControlHandle;
  141.  INLINE $A9BE;
  142. PROCEDURE DisposeControl(theControl: ControlHandle);
  143.  INLINE $A955;
  144. PROCEDURE KillControls(theWindow: WindowPtr);
  145.  INLINE $A956;
  146. PROCEDURE HideControl(theControl: ControlHandle);
  147.  INLINE $A958;
  148. PROCEDURE ShowControl(theControl: ControlHandle);
  149.  INLINE $A957;
  150. PROCEDURE DrawControls(theWindow: WindowPtr);
  151.  INLINE $A969;
  152. PROCEDURE Draw1Control(theControl: ControlHandle);
  153.  INLINE $A96D;
  154. PROCEDURE HiliteControl(theControl: ControlHandle;hiliteState: INTEGER);
  155.  INLINE $A95D;
  156. PROCEDURE UpdateControls(theWindow: WindowPtr;updateRgn: RgnHandle);
  157.  INLINE $A953;
  158. PROCEDURE UpdtControl(theWindow: WindowPtr;updateRgn: RgnHandle);
  159.  INLINE $A953;
  160. PROCEDURE MoveControl(theControl: ControlHandle;h: INTEGER;v: INTEGER);
  161.  INLINE $A959;
  162. PROCEDURE SizeControl(theControl: ControlHandle;w: INTEGER;h: INTEGER);
  163.  INLINE $A95C;
  164. PROCEDURE SetControlValue(theControl: ControlHandle;theValue: INTEGER);
  165.  INLINE $A963;
  166. PROCEDURE SetCtlValue(theControl: ControlHandle;theValue: INTEGER);
  167.  INLINE $A963;
  168. FUNCTION GetControlValue(theControl: ControlHandle): INTEGER;
  169.  INLINE $A960;
  170. FUNCTION GetCtlValue(theControl: ControlHandle): INTEGER;
  171.  INLINE $A960;
  172. PROCEDURE SetControlMinimum(theControl: ControlHandle;minValue: INTEGER);
  173.  INLINE $A964;
  174. PROCEDURE SetCtlMin(theControl: ControlHandle;minValue: INTEGER);
  175.  INLINE $A964;
  176. FUNCTION GetControlMinimum(theControl: ControlHandle): INTEGER;
  177.  INLINE $A961;
  178. FUNCTION GetCtlMin(theControl: ControlHandle): INTEGER;
  179.  INLINE $A961;
  180. PROCEDURE SetControlMaximum(theControl: ControlHandle;maxValue: INTEGER);
  181.  INLINE $A965;
  182. PROCEDURE SetCtlMax(theControl: ControlHandle;maxValue: INTEGER);
  183.  INLINE $A965;
  184. FUNCTION GetControlMaximum(theControl: ControlHandle): INTEGER;
  185.  INLINE $A962;
  186. FUNCTION GetCtlMax(theControl: ControlHandle): INTEGER;
  187.  INLINE $A962;
  188. PROCEDURE SetControlReference(theControl: ControlHandle;data: LONGINT);
  189.  INLINE $A95B;
  190. PROCEDURE SetCRefCon(theControl: ControlHandle;data: LONGINT);
  191.  INLINE $A95B;
  192. FUNCTION GetControlReference(theControl: ControlHandle): LONGINT;
  193.  INLINE $A95A;
  194. FUNCTION GetCRefCon(theControl: ControlHandle): LONGINT;
  195.  INLINE $A95A;
  196. PROCEDURE SetControlAction(theControl: ControlHandle;actionProc: ProcPtr);
  197.  INLINE $A96B;
  198. PROCEDURE SetCtlAction(theControl: ControlHandle;actionProc: ProcPtr);
  199.  INLINE $A96B;
  200. FUNCTION GetControlAction(theControl: ControlHandle): ProcPtr;
  201.  INLINE $A96A;
  202. FUNCTION GetCtlAction(theControl: ControlHandle): ProcPtr;
  203.  INLINE $A96A;
  204. PROCEDURE DragControl(theControl: ControlHandle;startPt: Point;limitRect: Rect;
  205.  slopRect: Rect;axis: INTEGER);
  206.  INLINE $A967;
  207. FUNCTION TestControl(theControl: ControlHandle;thePt: Point): INTEGER;
  208.  INLINE $A966;
  209. FUNCTION TrackControl(theControl: ControlHandle;thePoint: Point;actionProc: ProcPtr): INTEGER;
  210.  INLINE $A968;
  211. FUNCTION FindControl(thePoint: Point;theWindow: WindowPtr;VAR theControl: ControlHandle): INTEGER;
  212.  INLINE $A96C;
  213. PROCEDURE SetControlColor(theControl: ControlHandle;newColorTable: CCTabHandle);
  214.  INLINE $AA43;
  215. PROCEDURE SetCtlColor(theControl: ControlHandle;newColorTable: CCTabHandle);
  216.  INLINE $AA43;
  217. FUNCTION GetAuxiliaryControlRecord(theControl: ControlHandle;VAR acHndl: AuxCtlHandle): BOOLEAN;
  218.  INLINE $AA44;
  219. FUNCTION GetAuxCtl(theControl: ControlHandle;VAR acHndl: AuxCtlHandle): BOOLEAN;
  220.  INLINE $AA44;
  221. FUNCTION GetControlVariant(theControl: ControlHandle): INTEGER;
  222.  INLINE $A809;
  223. FUNCTION GetCVariant(theControl: ControlHandle): INTEGER;
  224.  INLINE $A809;
  225.  
  226.  
  227. {$ENDC} { UsingControls }
  228.  
  229. {$IFC NOT UsingIncludes}
  230.  END.
  231. {$ENDC}
  232.  
  233.